﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ExamRepositoryWebAPI.Models;
using ExamRepositoryWebAPI.DataRepositories;

namespace ExamRepositoryWebAPI.Controllers
{
    public class JudgementQuestionController : Controller
    {
        private readonly IRepository<JudgementQuestion, int> _repository;

        public JudgementQuestionController(IRepository<JudgementQuestion, int> repository)
        {
            _repository = repository;
        }
        public string Index()
        {
            return "SingleChoice Question Repository";
        }

        public ActionResult<List<JudgementQuestion>> GetAllList()
        {
            return _repository.GetAllList();
        }

        public void Delete(JudgementQuestion question)
        {
            _repository.Delete(question);
        }

        public ActionResult<JudgementQuestion> Update(JudgementQuestion question)
        {
            return _repository.Upadate(question);
        }

        public ActionResult<JudgementQuestion> Insert(JudgementQuestion question)
        {
            return _repository.Insert(question);
        }
    }
}
